Robot, device and method for controlling robot, and computer-readable non-transitory recording medium

ABSTRACT

A robot determines whether or not an operator or an object is jammed between a robot arm and an external structure, classifies an area in which an end portion of the robot arm moves into a restricted area and an unrestricted area, and sets a restriction period. If a period after detection of the jam is in the restriction period and the end portion is in the restricted area, restriction on movement is imposed on one or more joints of the robot arm. The restriction on movement is a stoppage of movement of one or more joints. If the period after detection of the jam is after the restriction period, the restriction on movement is removed. If the period after detection of the jam is in the restriction period and the end portion is in the unrestricted area, the restriction on movement is not imposed on the joints.

BACKGROUND

1. Technical Field

The present disclosure relates to a power-assist robot that performs anoperation in cooperation with an operator, a device and a method forcontrolling a robot, and a computer-readable non-transitory recordingmedium.

2. Description of the Related Art

In recent years, domestic robots, such as caregiver robots andhousekeeper robots, have been actively developed. Moreover, industrialrobots that cooperate with operators have been actively developed as aresult of, for example, cellular manufacturing factories having becomewidespread (see Japanese Unexamined Patent Application Publication No.11-277483 and WO2007/080733).

SUMMARY

An increased safety is needed for robots described above, whichcooperate with operators, because they operate in spaces in whichoperators work, in contrast to existing industrial robots or the like,which operate in work areas that are separated from those for operators.

One non-restricting and exemplary embodiment provides a power-assistrobot that can cooperate with operators with a higher level of safety ascompared with existing industrial robots or the like.

Additional benefits and advantages of the disclosed embodiments will beapparent from the specification and figures. The benefits and/oradvantages may be individually provided by the various embodiments andfeatures of the specification and drawings disclosure, and need not allbe provided in order to obtain one or more of the same.

In one general aspect, the techniques disclosed here feature a robotincluding a position information obtaining unit that obtains positioninformation about an end portion of a robot arm having a plurality ofjoints, a first force detector that detects a force that an operatorapplies to the robot arm, a jam determination unit that determineswhether or not the operator or an object is jammed between the robot armand an external structure on the basis of the force detected by thefirst force detector, an area classification unit that classifies anarea in which the end portion moves into a restricted area and anunrestricted area, and a restriction period setting unit that sets arestriction period during which movement of the robot arm is restricted.If a period after detection of the jam is in the restriction period andthe end portion is located in the restricted area, restriction onmovement is imposed on one or more of the joints and the restriction onmovement is not imposed on at least one of the joints excluding the oneor more of the joints. The restriction on movement is a stoppage ofmovement of one or more of the plurality of joints. If the period afterdetection of the jam is after the restriction period, the restriction onmovement is removed. If the period after detection of the jam is in therestriction period and the end portion is located in the unrestrictedarea, the restriction on movement is not imposed on the plurality ofjoints.

Note that general or specific aspects including the above-describedaspect may be implemented in a form of a system, a method, an integratedcircuit, a computer program, or a computer-readable recording medium,such as a compact disk read-only memory (CD-ROM), or may be implementedusing any combination of a system, a method, an integrated circuit, acomputer program, and a recording medium.

With the aspect of the present disclosure, it is possible to provide apower-assist robot that performs an operation in corporation with anoperator and that can move so as to allow the operator to safely get outof a jammed state while giving consideration to the effect on anexternal structure.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic view of a robot system according to a firstembodiment of the present disclosure.

FIG. 2 illustrates the structure of a robot system according to thefirst embodiment of the present disclosure.

FIG. 3 is a block diagram of a device for controlling a robot and a partof the robot, which is a controlled system, according to the firstembodiment of the present disclosure.

FIG. 4A is a graph illustrating an example of an algorithm of anoperator/object determination unit according to the first embodiment ofthe present disclosure.

FIG. 4B is a graph illustrating an example of an algorithm of theoperator/object determination unit according to the first embodiment ofthe present disclosure.

FIG. 5 is a sectional view of a path of an end portion of a robot arm,which is used to describe an example of operation performed by adirectional area classification unit according to the first embodimentof the present disclosure.

FIG. 6A illustrates an example of restricted directions stored in adirectional area classification unit according to the first embodimentof the present disclosure.

FIG. 6B illustrates an example of restricted directions stored in thedirectional area classification unit according to the first embodimentof the present disclosure.

FIG. 7 is a block diagram of a device for controlling a robot and a partof the robot, which is a controlled system, according to a secondembodiment of the present disclosure.

FIG. 8 is a sectional view of a path of an end portion of a robot arm,which is used to describe an example of operation performed by an areaclassification unit according to the second embodiment of the presentdisclosure.

FIG. 9 illustrates an example of an operation performed by the areaclassification unit according to the second embodiment of the presentdisclosure.

FIG. 10A is a graph illustrating an example of an algorithm of anoperator/object determination unit according to the second embodiment ofthe present disclosure.

FIG. 10B is a graph illustrating an example of an algorithm of theoperator/object determination unit according to the second embodiment ofthe present disclosure.

FIG. 11 is a diagram illustrating an expression used to calculate anelastic modulus in the first embodiment of the present disclosure.

FIG. 12 illustrates an example of an operator who is in a jammed statedescribed in the “Basic Findings” section of the present disclosure.

FIG. 13 is a table showing an example of an algorithm of a restrictionperiod setting unit according to the first embodiment of the presentdisclosure.

DETAILED DESCRIPTION Basic Findings

For example, existing power-assist robots that are used to move anobject in corporation with an operator can be also used to perform asimple operation of mounting the object in another object. In this case,it is likely that an object is moved not only through an empty space butalso through a space in which another object, into which the object isto be mounted, is placed. Even if the safety of the robot is increased,it may happen that an operator is exposed to some danger. Examples ofthe danger include a case where an operator becomes jammed between therobot or an object moved by the robot and an external structure. Forexample, FIG. 12 illustrates a case where an operator 91 uses apower-assist robot to mount an object 92, which is held by a robot arm21, in a surrounding object 95. In the final step, the operator 91 mayrelease his/her hand from the robot arm 21 and may directly touch theobject 92 in order to adjust the position of the object 92. At thistime, the hand of the operator 91 may become jammed between the object92 and the surrounding object 95.

Unfortunately, the technology disclosed in Japanese Unexamined PatentApplication Publication No. 11-277483 has a problem in that thetechnology does not effectively ensure the safety of an operator,because only the wrist axis is movable and therefore an operator mightnot be able to get out of a jammed state. Even when not only the wristaxis but also the main axis is movable, because the range of movement ofthe robot, including the main axis and the wrist axis, is small, anoperator might not be able to smoothly get out of a jammed state inwhich, for example, his/her hand is jammed. With the technologydisclosed in WO2007/080733, when the robot is used in a small space andif a hand of an operator becomes jammed, the operator might not be ableto get out of a jammed state because the space in which the operator canmove may be limited. When the robot arm is moved only in a movabledirection and in a predetermined direction, an operator might not beable to get out of a jammed state. In such a case, for safety of theoperator, a control device for controlling the robot needs to givepriority to an operation that allows the operator to get out of a jammedstate over consideration on the effect on the external structure.However, existing control devices are not capable of performing such anoperation.

The present disclosure provides a power-assist robot that performs anoperation in corporation with an operator, a device and a method forcontrolling a robot, and a computer-readable non-transitory recordingmedium that are capable of ensuring an increased level of safety ascompared with existing industrial robots or the like. To be specific,the robot can operate so as to allow an operator to rapidly and safelyget out of a jammed state while giving consideration to the effect onthe external structure.

Aspects of the present disclosure will be described below, beforedescribing embodiments of the present disclosure with reference to thedrawings.

A first aspect provides a robot including a position informationobtaining unit that obtains position information about an end portion ofa robot arm having a plurality of joints, a first force detector thatdetects a force that an operator applies to the robot arm, a jamdetermination unit that determines whether or not the operator or anobject is jammed between the robot arm and an external structure on thebasis of the force detected by the first force detector, an areaclassification unit that classifies an area in which the end portionmoves into a restricted area and an unrestricted area, and a restrictionperiod setting unit that sets a restriction period during which movementof the robot arm is restricted. If a period after detection of the jamis in the restriction period and the end portion is located in therestricted area, restriction on movement is imposed on one or more ofthe plurality of joints and the restriction on movement is not imposedon at least one of the plurality of joints excluding the one or more ofthe plurality of joints. The restriction on movement is a stoppage ofmovement of one or more of the plurality of joints. If the period afterdetection of the jam is after the restriction period, the restriction onmovement is removed. If the period after detection of the jam is in therestriction period and the end portion is located in the unrestrictedarea, the restriction on movement is not imposed on the plurality ofjoints.

According to the first aspect, the robot, which is a power-assist robotthat performs an operation in corporation with an operator, can move soas to allow the operator to safely get out of a jammed state whilegiving consideration to the effect on the external structure.

A second aspect provides the robot according to the first aspect,further including a second force detector that detects an external forcethat the robot arm receives from the outside. The jam determination unitdetermines that the operator or the object is jammed between the robotarm and the external structure on the basis of the force detected by thefirst force detector and the external force that the robot arm receivesfrom the outside and that is detected by the second force detector. Ifthe jam determination unit determines that a jam has occurred, movementof the robot arm is controlled on the basis of the external force thatthe robot arm receives from the outside and that is detected by thesecond force detector.

According to the second aspect, the robot can move so as to allow theoperator to safely get out of a jammed state because a jam can bedetected and the robot can be moved without fail even if the jam occursin a place where the first force detector cannot detect a force.

A third aspect provides the robot according to the second aspect, inwhich the area classification unit stores a map of an operation areaincluding the restricted area beforehand.

According to the third aspect, the robot can move so as to allow theoperator to safely get out of a jammed state while giving considerationto the effect on the external structure because a restricted area can bedetermined by using the map.

A fourth aspect provides the robot according to the second aspect, inwhich the area classification unit obtains a velocity of movement of theend portion and classifies an area in which the velocity of movement ofthe end portion is lower than a velocity threshold into the restrictedarea.

According to the fourth aspect, without determining a restricted areabeforehand, the area classification unit can determine a restricted areaand an unrestricted area by using the velocity of movement of the endportion. In the restricted area, restriction is imposed on the directionin which the robot arm is moved, and the restriction period setting unitallows the robot arm to be moved in any direction after the elapse of acertain restriction period. Thus, because the area classification unitestimates the effect on the external structure from the velocity ofmovement of the end portion and determines a restricted range (area) oran unrestricted range (area), it is possible to realize control even ifa map of an operation area is not stored beforehand.

A fifth aspect provides the robot according to the third aspect, inwhich the restricted area includes a plurality of areas, and in whichthe area classification unit is a directional area classification unitthat has information about a direction in which movement of each of theplurality of joints is restricted in each of the plurality of areas.

According to the fifth aspect, the robot can move so as to allow theoperator to more safely get out of a jammed state while givingconsideration to the effect on the external structure, because it ispossible to restrict only a direction specified for each of theplurality of areas.

A sixth aspect provides the robot according to the fifth aspect, inwhich one or more of the plurality of joints on which the restriction onmovement is to be imposed are determined on the basis of informationabout the plurality of areas and information about the direction inwhich movement of each of the plurality of joints is to be restricted,which are stored in the directional area classification unit.

According to the sixth aspect, the robot can move so as to allow theoperator to get out of a jammed state while giving consideration to theeffect on the external structure, because it is possible to restrictonly joints to be restricted in corresponding restricted areas.

A seventh aspect provides the robot according to the first aspect, inwhich the restriction on movement is not imposed on at least one of theplurality of joints near the end portion.

According to the seventh aspect, the robot can move so as to allow theoperator to get out of a jammed state while giving consideration to theexternal structure, because it is possible to restrict only joints to berestricted in corresponding restricted areas and because at least one ofthe joints near the end portion is not restricted.

An eighth aspect provides the robot according to the second aspect, inwhich the restriction period setting unit sets a shorter restrictionperiod when the external force detected by the second force detector islarger.

According to the eighth aspect, the robot can move so as to allow theoperator to safely get out of a jammed state, because, when a largeexternal force is applied, the robot recognizes that it is necessary tourgently allow the operator to get out of the jammed state and removesthe restriction in a short time.

A ninth aspect provides the robot according to the second aspect,further including an operator/object determination unit. Theoperator/object determination unit determines whether a body jammedbetween the end portion of the robot arm and the external structure isthe operator or the object on the basis of the position informationobtained by the position information obtaining unit, the external forcethat the robot arm receives from the outside and that is detected by thesecond force detector, and information determined by the jamdetermination unit. If the operator/object determination unit determinesthat the body is the operator, the restriction period setting unit setsthe restriction period to be shorter than that in a case where theoperator/object determination unit determines that the body is theobject.

According to the ninth aspect, it is possible to set a short restrictionperiod if the operator/object determination unit determines that theoperator has been jammed and to set a long restriction period if theoperator/object determination unit determines that the object has beenjammed. Therefore, if a jam occurs, by performing force control so thatthe object held by the end portion of the robot arm might not collidewith an external structure or the like, it is possible to control therobot arm to be moved in such a direction that allows the operator orthe object that has been jammed to get out of a jammed state. Moreover,the robot can move while ensuring a higher safety of an operator.

A tenth aspect provides the robot according to the ninth aspect, inwhich the second force detector estimates an estimated joint torque froma value of an electric current passing through a driving device of eachof the joints and position information obtained by the positioninformation obtaining unit, in which the operator/object determinationunit calculates an elastic modulus from the position informationobtained by the position information obtaining unit and the estimatedjoint torque estimated by the second force detector, and in which theoperator/object determination unit determines that the body that isjammed is the operator if the calculated elastic modulus is less than afirst operator-determination threshold and determines that the body thatis jammed is the object if the calculated elastic modulus is greaterthan or equal to the first operator-determination threshold.

According to the tenth aspect, it is possible to set a short restrictionperiod if the operator/object determination unit determines that theoperator has been jammed and to set a long restriction period if theoperator/object determination unit determines that the object has beenjammed. Therefore, if a jam occurs, by performing force control so thatthe object held by the end portion of the robot arm might not collidewith an external structure or the like, it is possible to control therobot arm to be moved in such a direction that allows the operator orthe object that has been jammed to get out of a jammed state. Moreover,the robot can move while ensuring a higher safety of an operator.

An eleventh aspect provides the robot according to the ninth aspect, inwhich the operator/object determination unit determines that the bodythat is jammed is the operator if a difference between a maximum valueand a minimum value of the external force that the robot arm receivesfrom the outside and that is detected by the second force detector isgreater than or equal to a second operator-determination threshold.

According to the eleventh aspect, it is possible to set a shortrestriction period if the operator/object determination unit determinesthat the operator has been jammed and to set a long restriction periodif the operator/object determination unit determines that the object hasbeen jammed. Therefore, if a jam occurs, by performing force control sothat the object held by the end portion of the robot arm might notcollide with an external structure or the like, it is possible tocontrol the robot arm to be moved in such a direction that allows theoperator or the object that has been jammed to get out of a jammedstate. Moreover, the robot can move while ensuring a higher safety of anoperator.

A twelfth aspect provides the robot according to the eighth aspect, inwhich the jam determination unit determines that a jam has occurred ifan input from the first force detector is zero and an input from thesecond force detector is greater than or equal to a certain value.

According to the twelfth aspect, the robot can move so as to allow theoperator to safely get out of a jammed state because a jam can bedetected and the robot can be moved without fail even if the jam occursin a place where the first force detector cannot detect a force.Moreover, if the first force detector can detect a force, with anordinary movement, the robot can perform an operation that allows theoperator to safely get out of a jammed state. Therefore, the robot canmove so as to allow the operator to more safely get out of a jammedstate while giving consideration to the effect on the externalstructure.

A thirteenth aspect provides a device for controlling a robot, thedevice including a position information obtaining unit that obtainsposition information about an end portion of a robot arm having aplurality of joints, a first force detector that detects a force that anoperator applies to the robot arm, a jam determination unit thatdetermines whether or not the operator or an object is jammed betweenthe robot arm and an external structure on the basis of the forcedetected by the first force detector, an area classification unit thatclassifies an area in which the end portion moves into a restricted areaand an unrestricted area, and a restriction period setting unit thatsets a restriction period during which movement of the robot arm isrestricted. If a period after detection of the jam is in the restrictionperiod and the end portion is located in the restricted area,restriction on movement is imposed on one or more of the plurality ofjoints and the restriction on movement is not imposed on at least one ofthe plurality of joints excluding the one or more of the plurality ofjoints. The restriction on movement is a stoppage of movement of one ormore of the plurality of joints. If the period after detection of thejam ends after the restriction period, the restriction on movement isremoved. If the period after detection of the jam is in the restrictionperiod and the end portion is located in the unrestricted area, therestriction on movement is not imposed on the plurality of joints.

According to the thirteenth aspect, the robot control device, which iscontrol device for a power-assist robot that performs an operation incorporation with an operator, allows the operator to safely get out of ajammed state while giving consideration to the effect on the externalstructure.

A fourteenth aspect provides a method for controlling a robot, themethod including a step of obtaining position information about an endportion of a robot arm having a plurality of joints, a step of detectinga force that an operator applies to the robot arm, a step of determiningwhether or not the operator or an object is jammed between the robot armand an external structure on the basis of the detected force, a step ofclassifying an area in which the end portion moves into a restrictedarea and an unrestricted area, and a step of setting a restrictionperiod during which movement of the robot arm is restricted. If a periodafter detection of the jam is in the restriction period and the endportion is located in the restricted area, restriction on movement isimposed on one or more of the plurality of joints and the restriction onmovement is not imposed on at least one of the plurality of jointsexcluding the one or more of the plurality of joints. The restriction onmovement is a stoppage of movement of one or more of the plurality ofjoints. If the period after detection of the jam is after therestriction period, the restriction on movement is removed. If theperiod after detection of the jam is in the restriction period and theend portion is located in the unrestricted area, the restriction onmovement is not imposed on the plurality of joints.

According to the fourteenth aspect, the method for controlling a robot,which is method for controlling a power-assist robot that performs anoperation in corporation with an operator, allows the operator to safelyget out of a jammed state while giving consideration to the effect onthe external structure.

A fifteenth aspect provides a computer-readable non-transitory recordingmedium storing a program for causing a computer to perform the methodfor controlling a robot according to the fourteenth aspect.

According to the fifteenth aspect, the computer-readable non-transitoryrecording medium storing a control program, which is a control programfor controlling a power-assist robot that performs an operation incorporation with an operator, allows the operator to safely get out of ajammed state giving consideration to the effect on the externalstructure.

Hereinafter, embodiments according to the present disclosure will bedescribed in detail with reference to the drawings.

First Embodiment

FIG. 1 is a schematic view of a robot system 100 according to the firstembodiment of the present disclosure.

A robot 20 of the robot system 100 includes a robot arm 21 and a handle22 attached to an end portion of the robot arm 21. The handle 22 is usedwhen an operator 91 applies a force to the robot arm 21. The robot 20further includes a suction pad 93 attached to the end portion of therobot arm 21. The suction pad 93 holds the object 92. When the operator91 applies a force to the handle 22, a force sensor 23 detects theforce. The robot arm 21 is moved in accordance with the detected force,so that the robot arm 21 can function as a power-assist arm forassisting the operator 91 in performing an operation, such as moving anobject. The robot arm 21 can move the object 92 by holding the object 92with the suction pad 93. In the present specification, the term “endportion” of the robot arm 21 refers to the end of the robot arm 21 andthe suction pad 93.

FIG. 2 illustrates the structure of the robot system 100 according tothe first embodiment of the present disclosure.

The robot system 100 includes a control device 50 and the robot 20,which is a controlled by the control device 50.

In the first embodiment, the control device 50 is implemented, forexample, in a general-purpose personal computer. The control device 50includes a control program 40 and an I/O interface 41.

The I/O interface 41 includes, for example, a D/A board, an A/D board,and a counter board, each of which is connected to an expansion slot,such as a PCI bus, of the personal computer.

The control device 50 is connected to a motor driver 42 via the I/Ointerface 41, which is an example of an input unit. The control device50 sends a control signal to the motor driver 42, and the motor driver42 drives link manipulators of a robot mechanism 6.

The robot 20 includes the robot arm 21 as described above. The structureof the robot arm 21 will be described below.

The control device 50 controls movement of the robot arm 21 as follows.An encoder 7 (described below) disposed in each joint of the robot arm21 outputs joint angle information about the joint (a rotation phaseangle and the like). The control device 50 receives the joint angleinformation about each joint through the counter board of the I/Ointerface 41. The control device 50 calculates a control command valuefor controlling rotation of the joint on the basis of the received jointangle information. The control device 50 sends the calculated controlcommand value through the D/A board of the I/O interface 41 to the motordriver 42 for driving each joint of the robot arm 21. Motors 19, whichare examples of a driving device for driving the joint of the robot arm21, are independently driven in accordance with the control commandvalue sent from the motor driver 42. The motor driver 42 and the motors19 function as an example of a drive unit. The encoders 7 function as anexample of an angle detection unit that outputs angle information(rotation phase angles and the like). In other words, each of theencoders 7 function as a position information obtaining unit thatobtains position information about an end portion of the robot arm 21.The motor driver 42 includes a current detector 8 for detecting anelectric current flowing through the motor 19. As described below, thecurrent detector 8 also functions as a second force detector fordetecting a second force (an external force that the robot arm 21receives from the outside) in corporation with a load torque estimationunit 13. The first force detector and the second force detector eachfunction as an example of a force detector.

The robot arm 21, including a base 34, is, for example, a multi-linkmanipulator having six degrees of freedom. The handle 22 and the suctionpad 93 can be attached to a wrist 31 at the end of the robot arm 21 viathe force sensor 23. The robot arm 21 includes the wrist 31, a secondlink 32, a first link 33, a second joint supporting column 35, and thebase 34. The wrist 31 is attached to an end of the second link 32. Abase end of the second link 32 is rotatably connected to an end of thefirst link 33. A base end of the first link 33 is rotatably connected toand supported by the second joint supporting column 35. The second jointsupporting column 35 is attached to the base 34, which is fixed to afloor 90. To measure a force that the operator 91 applies to the handle22 with his/her hand, the force sensor 23, which is an example of afirst force detector, is interposed between the handle 22 and the wrist31. The suction pad 93, which is used to hold the object 92, is alsoattached to the end of the wrist 31.

The wrist 31 has three rotation axes, which correspond to the axes of afourth joint 27, a fifth joint 28, and a sixth joint 29. The wrist 31allows the position (orientation) of the handle 22 to be changedrelative to the second link 32. The base end of the second link 32 isrotatable around a third joint 26 with respect to the end of the firstlink 33. The base end of the first link 33 is rotatable around a secondjoint 25 with respect to the second joint supporting column 35. An uppermovable portion 34 a of the base 34 is rotatable around a first joint 24with respect to a lower fixing portion 34 b of the base 34.

As a result, the robot arm 21 is structured as a multi-link manipulatorhaving six degrees of freedom, which is rotatable independently aroundsix rotation axes of the first joint 24 to the sixth joint 29.

Each of the joints, corresponding to rotary parts of the rotation axes,includes the motor 19 and the encoder 7, which are provided in one of apair of members of the joint (for example, a rotary member and a supportmember that supports the rotary member). The motor 19 is an example of arotary driving device that is controlled by the motor driver 42(described below). The encoder 7 detects a rotation angle of therotation shaft of the motor 19 (that is, a joint angle). (Actually, themotor 19 and the encoder 7 are disposed in each of the joints of therobot arm 21.) Thus, the rotation shaft of the motor 19, which isprovided in one of the members of each joint, is connected to the othermember of the joint. By rotating the rotation shaft in the forward orbackward direction, the other member can be rotated around the rotationaxis with respect to the one of the members.

FIG. 3 is a block diagram of the control device 50 for the robot 20 anda part of the robot 20, which is a controlled system, according to thefirst embodiment of the present disclosure.

The control device 50 for the robot 20 includes a desired pathgeneration unit 1, a desired angular acceleration calculation unit 2, adesired joint torque calculation unit 3, an inverse kinematicscalculation unit 4, an angular error compensation unit 5, an angularerror calculation unit 9, a corrected desired angular accelerationcalculation unit 10, a desired path addition unit 11, a jam detectionunit 12, a first force controller 14, a second force controller 16, anoperator/object determination unit 49, a restriction period setting unit51, a directional area classification unit (first area classificationunit) 52, a desired value addition unit 53, and a joint restriction unit54. The directional area classification unit 52 is an example of an areaclassification unit. The first force controller 14 and the second forcecontroller 16 each function as an example of a force controller.

The jam detection unit 12 includes the load torque estimation unit 13and a jam determination unit 15.

The robot 20 includes the robot mechanism 6, the encoder 7, the currentdetector 8, and the force sensor 23. The robot mechanism 6 includes therobot arm 21. The force sensor 23 is an example of a first forcedetector. Joint angle information measured by the encoder 7 is inputfrom the robot 20 to the control device 50. A first force (a forcevector F) measured by the force sensor 23 is input to the control device50. The first force is a force that the operator 91 applies to the robotarm 21 via the handle 22.

The desired path generation unit 1 outputs a desired position vectorr_(d) to the desired path addition unit 11. The desired position vectorr_(d) is used to make the robot 20 move along a desired path to performan operation. The path along which the robot 20 is moved is storedbeforehand in a storage unit of the desired path generation unit 1 asdesired positions r_(dt)=[r_(dt1), r_(dt2), r_(dt3), r_(dt4), r_(dt5),r_(dt6)]^(T) (r_(d0), r_(d1), r_(d2), . . . ) for the time t (t=0, t=t₁,t=t₂, . . . ). The desired path generation unit 1 generates a desiredposition vector r_(d)=[r_(d1), r_(d2), r_(d3), r_(d4), r_(d5),r_(d6)]^(T) by performing polynomial interpolation on a path betweenpoints (r_(d0), r_(d1), r_(d2), . . . ) for the time (t=0, t=t₁, t=t₂, .. . ).

The first force controller 14 calculates a corrected desired positionvector r_(dF) on the basis of the first force (the force vector F),which is output from the force sensor 23 of the robot 20, and outputsthe corrected desired position vector r_(dF) to the desired pathaddition unit 11. The first force controller 14 calculates a desiredposition vector r_(dF) by using a force control method, such as animpedance control method or a compliance control method. The forcesensor 23, which is an example of a first force detector, detects aforce that the operator 91 applies to the handle 22 of the robot arm 21.The first force controller 14 calculates the corrected desired positionvector r_(dF) on the basis of the detected force and outputs thecorrected desired position vector r_(dF). By using the method describedabove, it is possible to realize an operator-robot cooperative operationin which the robot arm 21 moves in a direction of a force that theoperator 91 applies to the robot arm 21.

The desired path addition unit 11 calculates a corrected desiredposition vector r_(dm) by adding a desired position vector r_(d), whichis output from the desired path generation unit 1, and a correcteddesired position vector r_(dF), which is output from the first forcecontroller 14. The desired path addition unit 11 outputs the correcteddesired position vector r_(dm) to the inverse kinematics calculationunit 4.

The inverse kinematics calculation unit 4 calculates a desired anglevector q_(d) from the corrected desired position vector r_(dm), which isinput from the desired path addition unit 11. The inverse kinematicscalculation unit 4 outputs the desired angle vector q_(d) to the desiredvalue addition unit 53. The desired angle vector q_(d) is calculatedfrom geometric information about the robot 20.

The load torque estimation unit 13 estimates a torque (estimated jointtorque) generated by each motor 19 from an electric current passingthrough the motor 19, which is output from the current detector 8, andjoint angle information of the joint, which is output from the encoder7. From the estimated torque, the load torque estimation unit 13estimates (detects) a force that the robot arm 21 receives from theoutside. The estimated force is output, as a second force, to the jamdetermination unit 15, the second force controller 16, theoperator/object determination unit 49, and the second force controller16.

A torque T_(m) generated by each motor 19 can be generally calculated asfollows:τ_(mN) =Kt _(N) ·i _(N)where τ_(mN) denotes a torque generated by the motor 19 for the rotationaxis of the N-th joint, i_(N) is the current value detected by thecurrent detector 8, and Kt_(N) is a torque coefficient of each rotationaxis (where N is the joint number).

Next, the load torque estimation unit 13 estimates a torque τ_(h) thatthe robot arm 21 receives from the outside by subtracting agravitational force acting on the robot arm 21 from the torque τ_(m)generated by the motor 19 of each rotation axis by using followingexpression:τ_(h)=τ_(m) −g(q)

where τ_(m) is a torque generated by the motor 19 for each rotationaxis, q is the angle information for each rotation axis input from theencoder 7, and g(q) is a gravity term acting on the robot arm 21.

The second force that is output is expressed by using torques applied tothe joints from the outside as follows:τ_(h)=[τ_(h1),τ_(h2),τ_(h3),τ_(h4),τ_(h5),τ_(h6)]^(T)

where n of τ_(hn) is the joint number.

While the robot arm 21 moves, each motor 19 outputs a torque expressedby the following expression:τ=M(q)·{umlaut over (q)}*+C(q,{dot over (q)})+g(q)

where M(q) and C(q,{dot over (q)}) are respectively coefficient matricesconsisting of dynamics parameters of the object 92 and the robot 20, and{umlaut over (q)}* is the angular acceleration.

The load torque estimation unit 13 estimates a torque applied to eachjoint when a jam occurs. Therefore, at this time, it is considered thatthe robot arm 21 is substantially at rest. A torque τ generated by eachmotor 19 when the robot arm 21 is at rest, including only the gravityterm, can be expressed as follows.τ=g(q)

By subtracting the gravity term from the torque τ_(m) generated by themotor 19 for each rotation axis, the load torque estimation unit 13 cancalculate the difference between a torque that is output by the motor 19and a torque needed to keep the robot arm 21 at rest. Therefore, theload torque estimation unit 13 can estimate that this difference is atorque applied to the robot arm 21 from the outside.

The jam determination unit 15 determines whether or not the operator 91or an object is jammed between the robot arm 21 and an externalstructure from the first force F input from the force sensor 23 and thesecond force input from the load torque estimation unit 13. If the jamdetermination unit 15 determines that a jam has occurred, the jamdetermination unit 15 outputs a jam signal and a joint number of a jointat which the jam has occurred to the second force controller 16 and tothe operator/object determination unit 49.

The term “jam” refers to a state in which at least a part of the body ofthe operator 91 or an object is jammed between the robot arm 21 and anexternal structure and it is difficult for the operator 91 to clear thejam. To be specific, even if a jam has actually occurs, the jamdetermination unit 15 does not determine that a jam has occurred if theoperator 91 is applying a force to the handle 22. This is because, whenthe operator 91 is applying a force to the handle 22, it is likely thatthe operator 91 is intentionally inserting a part of his/her bodybetween the robot arm 21 and the external structure in order to performan operation, or, even when the operator 91 has been accidentallyjammed, the operator 91 may be applying a force appropriately to get outof a jammed state.

If the magnitude of the force vector F input from the force sensor 23 isgreater than or equal to a predetermined threshold, the jamdetermination unit 15 determines that the operator 91 is applying aforce to the handle 22 and a jam has not occurred. If the magnitude ofthe force vector F input from the force sensor 23 is smaller than afirst jam-determination threshold (which is, for example, zero) and allof the components of the second force output from the load torqueestimation unit 13 are smaller than the predetermined secondjam-determination threshold, the jam determination unit 15 determinesthat a force is not applied to the robot arm 21 from the outside and ajam has not occurred. If the magnitude of the force vector F input fromthe force sensor 23 is smaller than the first jam-determinationthreshold and any one of the components of the second force output fromthe load torque estimation unit 13 is greater than or equal to thepredetermined second jam-determination threshold, the jam determinationunit 15 determines that a jam has occurred. If the jam determinationunit 15 determines that a jam has occurred, the jam determination unit15 also outputs the joint number of a joint at which the jam hasoccurred to the second force controller 16 and to the operator/objectdetermination unit 49. Thus, the jam determination unit 15 determinesthat a jam has occurred if an input from the force sensor 23 is zero (orsmaller than a certain value) and an input from the load torqueestimation unit 13, which is a part of the second force detector, isgreater than or equal to a certain value. Moreover, the jamdetermination unit 15 determines that the jam has occurred at one ofjoints at which a torque that is greater than or equal to apredetermined threshold is generated and that has the largest jointnumber. The reason for this is as follows. Referring to FIG. 2, forexample, if a jam occurs at the third joint 26, that is, if a force isapplied to the second link 32 in the direction of arrow a, a load torqueis generated at three joints, including the third joint 26, the secondjoint 25, and the first joint 24, due to the force applied to the robotarm 21 from the outside. However, a load torque is not generated at thefourth joint 27, the fifth joint 28, and the sixth joint 29, which arenearer to the end portion of the robot arm 21 than the second link 32is. Thus, the jam determination unit 15 determines that a jam hasoccurred at one of the joints at which a load torque greater than orequal to a threshold is generated and that is nearest to the end portionof the robot arm 21.

The operator/object determination unit 49 determines whether a body thathas been jammed is an operator or an object on the basis of the angleinformation input from the encoder 7, the second force input from theload torque estimation unit 13, and the jam signal input from the jamdetermination unit 15. The operator/object determination unit 49 outputsthe determination result to the restriction period setting unit 51.

The operator/object determination unit 49 constantly stores the angleinformation and the second force for a period (such as one second)determined beforehand by experiment or the like in a storage device 49 mof the operator/object determination unit 49. As a result, the storagedevice 49 m constantly stores the angle information and the second forcefrom one second before to the present time (when the control isperformed). If a jam signal is input from the jam determination unit 15,the operator/object determination unit 49 determines whether a body thathas been jammed is an operator or an object on the basis of informationfor the one second and information for a predetermined period from thetime at which the jam signal is input. The predetermined period from thetime at which the jam signal is input is also determined beforehand byexperiment or the like. Here, it is assumed, for example, that thepredetermined period is 0.5 seconds.

Referring to FIGS. 4A and 4B, this will be specifically described. Agraph in the upper part of FIG. 4A represents the relationship betweenthe time and the angle information, a graph in the middle part of FIG.4A represents the relationship between the time and the second force,and a graph in the lower part of FIG. 4A represents the relationshipbetween the time and the jam signal. Likewise, a graph in the upper partof FIG. 4B represents the relationship between the time and the angleinformation, a graph in the middle part of FIG. 4B represents therelationship between the time and the second force, and a graph in thelower part of FIG. 4B represents the relationship between the time andthe jam signal. FIG. 4A illustrates an example in which theoperator/object determination unit 49 determines that an operator hasbeen jammed. At time t=0, a jam signal (having a value “1” in the graph)is input. The angle information and the second force from t=−1 to t=0are stored in the storage device 49 m of the operator/objectdetermination unit 49. The angle information and the second force fromtime t=0 to 0.5 are also used. The second force and the angleinformation shown in FIG. 4A are the torque and the angle of a joint atwhich the jam determination unit 15 has estimated that a jam hasoccurred. The operator/object determination unit 49 calculates theelastic modulus K of a body (an operator or an object) that is jammed byusing the following expression:

$K = {\frac{\tau_{n\; 2} - \tau_{n\; 1}}{q_{n\; 2} - q_{n\; 1}}}$

where n is the joint number of a joint at which a jam has occurred,τ_(n2) is an estimated joint torque at time t=0.5, τ_(n1) is anestimated joint torque at time t=−1, q_(n2) is a joint angle output fromthe encoder 7 at time t=0.5, and q_(n1) is a joint angle output from theencoder 7 at time t=−1.

Referring to FIG. 11, this expression, which is used to calculate theelastic modulus K, will be described. It is not possible to find fromthe estimated joint torque at which position of a link 60 a jam hasoccurred. Therefore, it is assumed here that a jam has occurred at aposition on the link 60 that is at a length l from a joint axis(rotation axis) 61. A joint angle output from the encoder 7 immediatelybefore a jam occurs corresponds to q_(n1), and a joint angle output fromthe encoder 7 after a jam has occurred and when a force is applied to anobject 62 corresponds to q_(n2). An estimated joint torque immediatelybefore a jam occurs corresponds to τ_(n1), and an estimate joint torqueafter a jam has occurred and when a force is applied to the object 62corresponds to τ_(n2). Because it is considered that a change in thejoint angle due to a jam is small, the position of a point of contactbetween the object 62 and the link 60 changes only negligibly before andafter the occurrence of a jam. Assuming that the points of contactbefore and after the occurrence of a jam are both at the length l fromthe joint axis 61, a force applied from the link 60 to the object 62 dueto the jam can be expressed as follows.|l·τ _(n2) −l·τ _(n1)|)

An amount by which the object 62 is compressed due to the jamcorresponds to a displacement of a portion of the link 60 at the lengthl. Therefore, the amount of compression can be expressed as follows.|l·sin(q _(n2) −q _(n1))|

Because a change in the joint angle due to the jam is small, this can beapproximated as follows.|l·sin(q _(n2) −q _(n1))|≈|l·(q _(n2) −q _(n1))|

Thus, the elastic modulus K of the object 62 can be expressed asfollows.

$K = {{\frac{{l \cdot \tau_{n\; 2}} - {l \cdot \tau_{n\; 1}}}{l \cdot {\sin\left( {q_{n\; 2} - q_{n\; 1}} \right)}}} = {{\frac{l \cdot \left( {\tau_{n\; 2} - \tau_{n\; 1}} \right)}{l \cdot \left( {q_{n\; 2} - q_{n\; 1}} \right)}} = {\frac{\tau_{n\; 2} - \tau_{n\; 1}}{q_{n\; 2} - q_{n\; 1}}}}}$

If the elastic modulus K calculated by using the above expression islower than a predetermined first operator-determination threshold, theoperator/object determination unit 49 determines that an operator hasbeen jammed. When the operator/object determination unit 49 determinesthat an operator has been jammed, the operator/object determination unit49 outputs an operator signal to the restriction period setting unit 51.

FIG. 4B illustrates an example in which the operator/objectdetermination unit 49 determines that an object has been jammed. At timet=0, a jam signal (having a value “1” in the graph) is input. The angleinformation and the second force from t=−1 to t=0 are stored in thestorage device 49 m of the operator/object determination unit 49. Theangle information and the second force from time t=0 to 0.5 are alsoused. As in the case shown in FIG. 4A, the operator/object determinationunit 49 calculates the elastic modulus K. Because the calculated elasticmodulus K is higher than the threshold and higher than that of anoperator, the operator/object determination unit 49 determines that anobject has been jammed. When the operator/object determination unit 49determines that an object has been jammed, the operator/objectdetermination unit 49 outputs an object signal to the restriction periodsetting unit 51. Irrespective of whether the operator/objectdetermination unit 49 determines that an operator has been jammed or anobject has been jammed, the operator/object determination unit 49outputs to the restriction period setting unit 51 a torque in a state inwhich a jam has occurred and a force is applied to an operator or anobject, that is, the estimate joint torque τ_(n2) in the case where aforce is applied as illustrated in FIG. 11.

The restriction period setting unit 51 outputs a predeterminedrestriction period to the joint restriction unit 54 on the basis ofwhether an operator signal or an object signal has been output from theoperator/object determination unit 49 and a force generated due to thejam.

FIG. 13 is a table showing an example of an algorithm of the restrictionperiod setting unit 51. The restriction period setting unit 51 stores arestriction period for each of cases where a body that is jammed is anobject or an operator or where a force generated due to a jam is greaterthan a predetermined threshold or smaller than or equal to thepredetermined threshold. The restriction period is a period during whichthe joint restriction unit 54 imposes a restriction (on movement) on ajoint in force control performed after a jam has occurred. Thus, if theoperator/object determination unit 49 determines that an operator hasbeen jammed, the restriction period setting unit 51 sets a shortrestriction period in consideration of safety of the operator. Incontrast, if the operator/object determination unit 49 determines thatan object has been jammed, the restriction period setting unit 51 sets arestriction period longer than that of the case where the operator hasbeen jammed in consideration of the effect on the external structure. Ifa force generated due to a jam is large, the operator/objectdetermination unit 49 considers that the effect on the robot 20 and aneffect an operator or an object that has been jammed would be large, andthe operator/object determination unit 49 sets a restriction periodshorter than that of a case where the force is small.

The second force controller 16 calculates a desired angle vector on thebasis of a torque applied to each joint, which is an output from theload torque estimation unit 13, and outputs the desired angle vector tothe joint restriction unit 54. The second force controller 16 calculatesthe desired angle vector by using a force control method, such as animpedance control method or a compliance control method. The load torqueestimation unit 13 estimates a force applied to the robot arm 21 fromthe outside due to a jam or the like in addition to a force that theoperator 91 applies to the handle 22 attached to the robot arm 21 as atorque (estimated joint torque) acting on each joint. The second forcecontroller 16 calculates the desired angle vector on the basis of theestimated force and outputs the desired angle vector to the jointrestriction unit 54. By using such a method, force control is realizedin which the robot arm 21 is moved in a direction of a load torqueapplied to the robot arm 21 and the robot arm 21 is moved in a directionin which a force is applied from the outside when a jam occurs. When theforce control is performed, the robot arm 21 is moved in a direction inwhich a force is applied from the outside and, if a jam occurs, therobot arm 21 is moved in such a direction that the jam is cleared due toa force that the robot arm 21 receives from an operator or an objectthat has been jammed. Therefore, the operator or the object that hasbeen jammed can get out of a jammed state.

A storage unit of the directional area classification unit 52 stores amap of an operation area of the robot arm 21. Directions in whichmovement is to be restricted are stored in the map beforehand. Thedirectional area classification unit 52 outputs a direction in whichmovement from the present position (the position of the robot arm 21when control is performed) is to be restricted to the joint restrictionunit 54 on the basis of the angle information input from the encoder 7.FIG. 5 illustrates an example of an operation area classified by thedirectional area classification unit 52. In this example, it is assumedthat movement in the z-axis direction (a direction perpendicular to theplane of FIG. 5) is small, and movement of the robot arm 21 along thexy-plane at a predetermined z coordinate will be described. In FIG. 5,an annular area between an outer circle A and an inner circle B is anarea in which the suction pad 93 of the robot arm 21 is movable. It isassumed that the robot arm 21 performs an exemplary operation in whichthe robot arm 21 picks up the object 92 in an elliptical area C andmoves the object 92 to a workbench 94 in an elliptical area D. It isassumed that a wall E, which is an example of an external structure, ispresent behind the area D (that is, below the area D in FIG. 5). In thiscase, it may happen that a part of an object or an operator becomesjammed between the workbench 94 in the area D and the object 92.However, even in such a case, it is desirable that a collision betweenthe wall E and the object 92 be avoided to reduce the effect on the wallE, which is an external structure. (Avoiding a collision between theobject 92 and the wall E corresponds to minimizing the effect on theexternal structure.) In order to prevent the object 92 from collidingwith the wall E in an area FR, which includes the area D, thedirectional area classification unit 52 prohibits movement of the firstjoint 24.

The area FR can be represented by the following expression:−X ₁ ≦x≦X ₁ ,Y ₁ ≦y≦Y ₂

where X₁ is an x-coordinate along a surface of the wall E.

In FIG. 5, a part of the annular area between the outer circle A and theinner circle B that overlaps the area FR is a restricted area in whichmovement of the first joint 24 is prohibited (an area in whichrestriction of movement is imposed on the robot arm 21). A part of theannular area between the outer circle A and the inner circle B that doesnot overlap the area FR is an unrestricted area in which movement of thefirst joint 24 is not prohibited (an area in which movement of the robotarm is not restricted) irrespective of whether or not the present timeis in a restriction period.

The directional area classification unit 52 determines whether or notthe suction pad 93 (the end portion of the robot arm) is located in thearea FR on the basis of the angular information input from the encoder7. If it is determined that the suction pad 93 is located in the areaFR, the directional area classification unit 52 outputs informationshown in FIG. 6A to the joint restriction unit 54. If it is determinedthat the suction pad 93 is not located in the area FR, the directionalarea classification unit 52 outputs information shown in FIG. 6B to thejoint restriction unit 54. In FIGS. 6A and 6B, “1” means thatrestriction (on movement) is imposed on a joint and “0” means thatrestriction (on movement) is not imposed on a joint.

The directional area classification unit 52 may store a plurality ifmaps of operation areas including restricted areas. In this case, thedirectional area classification unit 52 may output, to the jointrestriction unit 54, information about directions in which restrictionon movement is imposed on the joints, as shown in FIG. 6A or 6B, foreach of the maps of operation areas including a plurality of restrictedareas on the basis of the position of the suction pad 93 (the endportion of the robot arm). Restriction on movement need not be imposedon at least one joint that is near the end portion of the robot arm 21.

On the basis of information on restricted directions output from thedirectional area classification unit 52, the joint restriction unit 54calculates a restricted desired angle vector q_(dm) by updatingcomponents of the desired angle vector, which is output from the secondforce controller 16, related to unrestricted directions while leavingcomponents of the desired angle vector related to restricted directionsunchanged. The joint restriction unit 54 outputs the restricted desiredangle vector q_(dm) to the desired value addition unit 53. However,after the elapse of the restriction period output from the restrictionperiod setting unit 51, the joint restriction unit 54 calculates therestricted desired angle vector q_(dm) by updating all of the componentsof the desired angle vector and outputs the desired restricted desiredangle vector q_(dm) to the desired value addition unit 53.

Specific operations are realized as described below.

The storage unit of the joint restriction unit 54 constantly stores therestricted desired angle vector q_(dm), which has been calculated in thepreceding calculation period. If the present time is in a restrictionperiod output from the restriction period setting unit 51, in thepresent calculation period, the joint restriction unit 54 does notupdate the components of the desired angle vector related tounrestricted directions and outputs the desired angle vector to thedesired value addition unit 53. The joint restriction unit 54 replacescomponents of the desired angle vector related to restricted directionswith corresponding components of a restricted desired angle vector thatis stored, and the joint restriction unit 54 outputs the restricteddesired angle vector to the desired value addition unit 53. Finally, thejoint restriction unit 54 stores the restricted desired angle vector inthe storage unit thereof. The robot arm 21 is moved on the basis of therestricted desired angle vector q_(dm) output from the joint restrictionunit 54 (to be precise, on the basis of information including therestricted desired angle vector q_(dm), as described below). As aresult, the robot arm 21 is moved in a direction of a load torque thatis not restricted but is not moved in a direction of a load torque thatis restricted. If the present time is not in a restriction period outputfrom the restriction period setting unit 51, in the present calculationperiod, the joint restriction unit 54 outputs the desired angle vectoras it is to the desired value addition unit 53 as the restricted desiredangle vector q_(dm) and stores the restricted desired angle vectorq_(dm) in the storage unit thereof. The robot arm 21 is moved on thebasis of the restricted desired angle vector q_(dm) output from thejoint restriction unit 54 (to be precise, on the basis of informationincluding the restricted desired angle vector q_(dm), as describedbelow). As a result, the robot arm 21 is moved in any direction in whicha load torque is directed.

The desired value addition unit 53 calculates a final angle desiredvalue q_(dt) by adding the restricted desired angle vector q_(dm) outputfrom the joint restriction unit 54 to the desired angle vector q_(d)output from the inverse kinematics calculation unit 4. The desired valueaddition unit 53 outputs the final angle desired value q_(dt) to thedesired angular acceleration calculation unit 2 and to the angular errorcalculation unit 9.

The angular error calculation unit 9 calculates an angular error vectorq_(e)=q_(dt)−q, which is an example of an output error, from the desiredangle vector q_(dt) output from the desired value addition unit 53 andan output q of the encoder 7. The angular error calculation unit 9outputs the angular error vector q_(e) to the angular error compensationunit 5.

The desired angular acceleration calculation unit 2 calculates a desiredangular acceleration {umlaut over (q)}_(d) from the desired angle vectorq_(dt) output from the desired value addition unit 53. The desiredangular acceleration calculation unit 2 outputs the desired angularacceleration {umlaut over (q)}_(d) to the corrected desired angularacceleration calculation unit 10.

The angular error compensation unit 5 calculates an angular errorcorrection command value ΔP_(qe), which is an example of a controlcommand value, from the angular error vector q_(e) output from theangular error calculation unit 9. The angular error compensation unit 5outputs the angular error correction command value ΔP_(qe) to thecorrected desired angular acceleration calculation unit 10.

The corrected desired angular acceleration calculation unit 10calculates a corrected desired angular acceleration {umlaut over(q)}_(d)*, which is an example of a control command value, from thedesired angular acceleration {umlaut over (q)}_(d) output from thedesired angular acceleration calculation unit 2 and the angular errorcorrection command value ΔP_(qe) output from the angular errorcompensation unit 5. The corrected desired angular accelerationcalculation unit 10 outputs the corrected desired angular acceleration{umlaut over (q)}_(d)* to the desired joint torque calculation unit 3.

The desired joint torque calculation unit 3 calculates a desired jointtorque τ_(d) from a corrected desired angular acceleration {umlaut over(q)}_(d) output from the corrected desired angular accelerationcalculation unit 10 and a dynamics parameter stored in the storage unitof the desired joint torque calculation unit 3. The desired joint torquecalculation unit 3 outputs the desired joint torque τ_(d) to the motordriver 42 of the robot mechanism 6. The desired joint torque τ_(d) canbe calculated by using, for example, the following expression:τ_(d) =M(q)·{umlaut over (q)} _(d) *+C(q,{dot over (q)})+g(q)

where M(q) and C(q,{dot over (q)}) are respectively coefficient matricescomposed of dynamic parameters of the object 92 and the robot 20, andg(q) is a gravity term acting on the mass of the object 92 and the robot20.

The desired joint torque τ_(d) is input from the desired joint torquecalculation unit 3 to the motor driver 42 via the I/O interface 41, suchas a D/A board, as a desired torque value. The motor driver 42 causesthe motors 19 of the joint axes to independently rotate in the forwardor backward direction, and thereby the robot arm 21 of the robotmechanism 6 is operated.

When the robot arm 21 of the robot mechanism 6 moves, the joint anglesof the robot arm 21 change. The encoder 7 detects the joint angles q andoutputs the detected joint angles q to the angular error calculationunit 9 via the I/O interface 41.

As described above, the control device 50 according to the firstembodiment includes the desired path generation unit 1, the desiredangular acceleration calculation unit 2, the desired joint torquecalculation unit 3, the inverse kinematics calculation unit 4, theangular error compensation unit 5, the angular error calculation unit 9,the corrected desired angular acceleration calculation unit 10, thedesired path addition unit 11, the jam detection unit 12, the firstforce controller 14, the second force controller 16, the operator/objectdetermination unit 49, the restriction period setting unit 51, thedirectional area classification unit 52, the desired value addition unit53, and the joint restriction unit 54. The jam detection unit 12includes the load torque estimation unit 13 and the jam determinationunit 15. The robot 20 includes the robot mechanism 6 including the robotarm 21; the encoders 7; the force sensor 23, which is an example of afirst force detector; the current detector 8; and the motors 19, whosetorque is controlled. The jam detection unit 12 detects whether or not ajam has occurred and a force acting on the robot arm 21 from the outsidewhen a jam occurs. The second force controller 16 performs force controlfor moving the robot arm 21 on the basis of the force acting on therobot arm 21. At this time, the directional area classification unit 52restricts the direction in which the robot arm 21 is moved in accordancewith the operation area in which the suction pad 93 is located.Moreover, after the elapse of a certain restriction period, therestriction period setting unit 51 allows the robot 20 to be moved inany direction. In other words, if the jam determination unit 15determines that a jam has occurred, during a restriction period set bythe restriction period setting unit 51 to impose a restriction onmovement, control is performed as follows: if the directional areaclassification unit 52 determines that the end portion of the robot arm21 is located in the restricted area determined by the directional areaclassification unit 52 on the basis of information about the position ofthe end portion of the robot arm 21 obtained by the encoders 7, movementof one or more of the joints to be restricted is stopped and the firstforce controller 14 controls movement of at least one of the joints thatare not restricted. Thus, movement of at least one of the joints near tothe end portion of the robot arm 21 is not restricted. After the elapseof the restriction period set by the restriction period setting unit 51,the restriction on the joints is removed. Moreover, if the directionalarea classification unit 52 determines that the end portion of the robotarm 21 is located in the unrestricted area determined by the directionalarea classification unit 52, the first force controller 14 controlsmovement of the joints without restricting movement of any of thejoints. It is possible to set a short restriction period if theoperator/object determination unit 49 determines that the operator 91has been jammed, and it is possible to set a long restriction period ifthe operator/object determination unit 49 determines that an object hasbeen jammed. As a result of performing control as described above, if ajam occurs, by performing force control so that the object 92 held bythe suction pad 93 might not collide with an external structure or thelike, it is possible to control the robot arm 21 to be moved in such adirection that allows an operator or an object that has been jammed toget out of a jammed state. If it is not possible for an operator or anobject to get out of a jammed state by moving the robot arm 21 in anoperation area in which the object 92 does not collide with an externalstructure or the like, force control is performed so as to allow alljoints to be moved after the elapse of the restriction period.Therefore, the robot arm 21 moves in a direction in which the robot arm21 receives a force from the operator or the object that has beenjammed, and therefore the operator or the object can get out of a jammedstate. In consideration of safety of an operator, if it is determinedthat an operator has been jammed, a short restriction period is set sothat the operator can get out of a jammed state without fail in a timeshorter than that of a case where an object is jammed. For example, therestriction period setting unit 51 may set a shorter restriction periodwhen an external force (second force) detected by the second forcedetector is larger.

Second Embodiment

FIG. 7 is a block diagram of a control device 50 for a robot 20 and apart of the robot 20, which is a controlled system, according to asecond embodiment of the present disclosure. In the first embodiment,information (restriction information) about an area in which movement ofthe robot arm 21 is restricted and an area in which movement of therobot arm 21 is not restricted is stored beforehand. In contrast, in thesecond embodiment, restriction information is not stored beforehand butis generated from information obtained while controlling the movement ofthe robot arm 21.

The control device 50 for the robot 20 includes a desired pathgeneration unit 1, a desired angular acceleration calculation unit 2, adesired joint torque calculation unit 3, an inverse kinematicscalculation unit 4, an angular error compensation unit 5, an angularerror calculation unit 9, a corrected desired angular accelerationcalculation unit 10, a desired path addition unit 11, a jam detectionunit 12, a first force controller 14, a second force controller 16, anoperator/object determination unit 49, a restriction period setting unit51, a second area classification unit 55, a desired value addition unit53, and a joint restriction unit 54. The second area classification unit55 is another example of an area classification unit.

The jam detection unit 12 includes a load torque estimation unit 13 anda jam determination unit 15.

The robot 20 includes a robot mechanism 6, an encoder 7, a currentdetector 8, and a force sensor 23. The robot mechanism 6 includes arobot arm 21. The force sensor 23 is an example of a first forcedetector. Joint angle information measured by the encoder 7 is inputfrom the robot 20 to the control device 50. A first force (a forcevector F) obtained by the force sensor 23 is input to the control device50. The first force is a force that an operator 91 applies to the robotarm 21 via a handle 22.

The operator/object determination unit 49 determines that the operator91 is jammed if the difference between the maximum value and the minimumvalue of the second force in a period from a time that is a certain time(such as 0.5 seconds, which may be determined by experiment beforehand)after a jam signal was input to a time that is a further time (such as 1second) after the jam signal was input is greater than or equal to apredetermined threshold. If the difference is smaller than thethreshold, the operator/object determination unit 49 determines that anobject has been jammed. This is because it is considered that, if anoperator has been jammed, a joint of the robot arm 21 can move in acertain range and a force applied to the robot arm 21 changes, but, ifan object has been jammed, a force applied to the robot arm 21 does notchange.

Referring to FIGS. 10A and 10B, this will be specifically described.FIG. 10A illustrates an example in which the operator/objectdetermination unit 49 determines that an operator has been jammed. Attime t=0, a jam signal is input. The operator/object determination unit49 calculates the difference between the maximum value τ_(n2) and theminimum value τ_(n1) of the second force from time t=0.5 to t=1.5.Because the difference is greater than or equal to a predeterminedsecond operator-determination threshold, the operator/objectdetermination unit 49 determines that an operator has been jammed. Whenthe operator/object determination unit 49 determines that an operatorhas been jammed, the operator/object determination unit 49 outputs anoperator signal to the restriction period setting unit 51.

FIG. 10B illustrates an example in which the operator/objectdetermination unit 49 determines that an object has been jammed. At timet=0, a jam signal is input. The operator/object determination unit 49calculates the difference between the maximum value τ_(n2) and theminimum value τ_(n1) of the second force from time t=0.5 to t=1.5.Because the difference is smaller than the predetermined threshold, theoperator/object determination unit 49 determines that an object has beenjammed. When the operator/object determination unit 49 determines thatan object has been jammed, the operator/object determination unit 49outputs an object signal to the restriction period setting unit 51. InFIGS. 10A and 10B, as in FIGS. 4A and 4B, n is the joint number of ajoint at which a jam has occurred, tint is an estimated joint torque attime t=0.5, τ_(n1) is an estimated joint torque at time t=−1, q_(n2) isa joint angle output from the encoder 7 at time t=0.5, and q_(n1) is ajoint angle output from the encoder 7 at time t=−1.

The second area classification unit 55 calculates the end velocity ofthe of the robot arm 21 (the velocity of movement of the end portion ofthe robot arm 21) on the basis of angle information output from theencoder 7. In accordance with the calculated end velocity, the secondarea classification unit 55 classifies the current position of the endportion into a restricted area and an unrestricted area, and outputs theclassification result to the joint restriction unit 54. To calculate theend velocity, the second area classification unit 55 calculates theposition of the end portion (the suction pad 93) on the basis of angleinformation input from the encoder 7 and geometric information about therobot arm 21, and the second area classification unit 55 differentiatethe change in the position with respect to time.

Referring to FIG. 8, an operation performed by the second areaclassification unit 55 will be described. In the example illustrated inFIG. 8, it is assumed that movement in the z-axis direction is small,and movement of the robot arm 21 along the xy-plane at a predetermined zcoordinate, around which the robot arm 21 moves, will be described. InFIG. 8, an annular area between an outer circle A and an inner circle Bis an area in which the suction pad 93 attached to the end of the robotarm 21 is movable. It is assumed that the robot arm 21 performs anexemplary operation in which the robot arm 21 picks up the object 92 inan elliptical area C and moves the object 92 to a workbench 94 in anelliptical area D. It is assumed that walls E, which are examples of anexternal structure, are present on the left side, on the right side, andbehind the area D (that is, on the left side, on the right side, andbelow the area D in FIG. 8). It is assumed that the position of the endportion of the robot arm 21 moves along a path from a point a to a pointb in a certain operation. The path of the end portion is represented bya solid line. The operator 91 picks up the object 92 at the point a andstarts moving the object 92. Because there are no obstacles near thepath from the point a to the point d, the end of the robot arm 21 movesfrom the point a toward the point d with a comparatively high velocity.When approaching the point d, the velocity of the end of the robot arm21 is reduced so that the object 92 can be moved toward the point bwhile avoiding a collision between the object 92 and the walls E. Then,the robot arm 21 reaches the point b. During this operation, the secondarea classification unit 55 calculates the position of the end portionof the robot arm 21 and the end velocity with which the end portionpasses the position by using the angle information input from theencoder 7. If the calculated end velocity is higher than or equal to apredetermined velocity threshold, the second area classification unit 55classifies restriction information about the position into “0”(unrestricted). If the calculated end velocity is lower than thevelocity threshold, the second area classification unit 55 classifiesrestriction information about the position into “1” (restricted). FIG. 9shows a specific example of classification performed by the second areaclassification unit 55. At time t=t_(n), the end portion of the robotarm 21 passes the point d in FIG. 8, and the operator 91 reduces thevelocity of the robot arm 21. As a result, no restriction is imposeduntil time t=t_(n). The second area classification unit 55 outputsrestriction information “0” to the joint restriction unit 54. After timet_(n+1), the second area classification unit 55 outputs restrictioninformation “1”, because the velocity of the end portion of the robotarm 21 has become high.

A storage unit of the joint restriction unit 54 stores information aboutjoints on which restriction of movement is to be imposed (joints to bestopped) and information about joints on which restriction of movementis not to be imposed (joints to be moved). If the present time is in arestriction period output from the restriction period setting unit 51,the joint restriction unit 54 calculates a restricted desired anglevector q_(dm) by updating components of the desired angle vector, whichis output from the second force controller 16, related to unrestricteddirections while leaving components of the desired angle vector relatedto restricted directions unchanged. The joint restriction unit 54outputs the restricted desired angle vector q_(dm) to the desired valueaddition unit 53. However, after the elapse of the restriction periodoutput from the restriction period setting unit 51, the jointrestriction unit 54 calculates the restricted desired angle vectorq_(dm) by updating all of the components of the desired angle vector andoutputs the desired restricted desired angle vector q_(dm) to thedesired value addition unit 53. If restriction information input fromthe second area classification unit 55 is “0” at the time at which thedesired angle vector is started to be input from the second forcecontroller 16, that is, at the time at which the jam determination unit15 determines that a jam has occurred, irrespective of the restrictionperiod output from the restriction period setting unit 51, the jointrestriction unit 54 calculates a restricted desired angle vector q_(dm)by updating all components of the desired angle vector and outputs therestricted desired angle vector q_(dm) to the desired value additionunit 53. If the restriction information is “1”, which means that thepresent position is in a restricted area, during the restriction period,the joint restriction unit 54 calculates the restricted desired anglevector q_(dm) by updating components of the desired angle vector relatedto unrestricted joints while leaving components of the desired anglevector related to restricted joints unchanged and outputs the restricteddesired angle vector q_(dm) to the desired value addition unit 53.

Specific operation of imposing restriction is the same as that of thefirst embodiment.

The joint restriction unit 54 determines joints that are to berestricted and joints that are not to be restricted beforehand asfollows. The joint restriction unit 54 sorts the joints in thedescending order of the distance over which the end portion of the robotarm 21 is moved when the joint is operated. The joint restriction unit54 determines a restricted joint group that includes some of the jointsthat move the end portion of the robot arm 21 over a comparatively largedistance and an unrestricted joint group including the remaining joints.For example, in the robot arm 21 illustrated in FIG. 2, for the rotationof 10 degrees, the first joint 24 moves the end portion over the largestdistance, and the second joint 25, the third joint 26, and the fourthjoint 27 respectively moves the end portion over the second, third, andfourth largest distances, and so on. Therefore, the joint restrictionunit 54 classifies the first joint 24, the second joint 25, and thethird joint 26 as restricted joints, and classifies other joints asunrestricted joints, and store the classification in the storage unitthereof. In other words, restriction is not imposed on at least one ofthe joints near the end portion of the robot arm 21.

As described above, the control device 50 according to the secondembodiment includes the desired path generation unit 1, the desiredangular acceleration calculation unit 2, the desired joint torquecalculation unit 3, the inverse kinematics calculation unit 4, theangular error compensation unit 5, the angular error calculation unit 9,the corrected desired angular acceleration calculation unit 10, thedesired path addition unit 11, the jam detection unit 12, the firstforce controller 14, the second force controller 16, the operator/objectdetermination unit 49, the restriction period setting unit 51, thesecond area classification unit 55, the desired value addition unit 53,and the joint restriction unit 54. The jam detection unit 12 includesthe load torque estimation unit 13 and the jam determination unit 15.The robot 20 includes the robot mechanism 6 including the robot arm 21;the encoders 7; the force sensor 23, which is an example of a firstforce detector; the current detector 8; and the motors 19, whose torqueis controlled. The jam detection unit 12 detects whether or not a jamhas occurred and a force acting on the robot arm 21 from the outsidewhen a jam occurs. The second force controller 16 performs force controlfor moving the robot arm 21 on the basis of the force acting on therobot arm 21. At this time, the second area classification unit 55 candetermine whether the present area is a restricted area or anunrestricted area from an operation velocity (such as the velocity ofthe end portion of the robot arm 21) immediately before the present timeeven though restricted areas have not been determined beforehand. If thepresent area is a restricted area, the direction in which the robot armis to be moved is restricted. Moreover, the restriction period settingunit 51 allows the robot arm 21 to be moved in any direction after theelapse of a certain restriction period. It is possible to set a shortrestriction period if the operator/object determination unit 49determines that the operator 91 has been jammed, and it is possible toset a long restriction period if the operator/object determination unit49 determines that an object has been jammed. As a result of performingcontrol as described above, if a jam occurs, by performing force controlso that the object 92 held by the suction pad 93 might not collide withan external structure or the like, it is possible to control the robotarm 21 to be moved in such a direction that allows the operator or anobject that has been jammed to get out of a jammed state. If it is notpossible for an operator or an object to get out of a jammed state bymoving the robot arm 21 in an operation area in which the object 92 doesnot collide with an external structure or the like, force control isperformed so as to allow all joints to be moved after the elapse of therestriction period. Therefore, the robot arm 21 moves in a direction inwhich the robot arm 21 receives a force from the operator or the objectthat has been jammed, and therefore the operator or the object can getout of a jammed state. In consideration of safety of an operator, if itis determined that an operator has been jammed, a short restrictionperiod is set so that the operator can get out of a jammed state withoutfail in a time shorter than that of a case where an object is jammed.Even in a case where a map of an operation area is not storedbeforehand, it is possible to realize the control because the secondarea classification unit 55 estimates the effect on an externalstructure from an immediately preceding operation state and determineswhether the present area is a restricted area or an unrestricted area.

In the first and second embodiments, the robot arm 21 having six axes isused as an example. However, this is not a restriction.

In the first and second embodiments, the second force detector performsestimation on the basis of an electric current in the motor. However,this is not a restriction. For example, each joint axis may be providedwith a torque sensor or any other estimation means.

The present disclosure can be applied to not only a robot that performsan operation of moving an object but also to a robot that performs anassembly operation or a processing operation by using a tool attached toan end of the arm.

The present disclosure is not restricted to the first and secondembodiments described above. The present disclosure also includes thefollowing cases.

A part or all of the control device 50 is, specifically, a computersystem including a microprocessor, a ROM, a RAM, a hard disk unit, adisplay unit, a keyboard, and a mouse. A computer program is stored inthe RAM or the hard disk unit. As the microprocessor executes thecomputer program, each unit performs its function. The computer programincludes a plurality of instruction codes that cause the computer toperform a predetermined function.

For example, each element is realized when a processor, such as a CPU,reads a software program stored in a storage medium, such as hard diskor a semiconductor memory, and executes the software program.

A program that realizes some or all of the elements of the controldevice according to the embodiments or modifications is configured asfollows. The program is a control program for a multi-link robot thatcauses the computer to function as a force controller, a first forcedetector, a jam determination unit, a joint restriction unit, an areaclassification unit, and a restriction period setting unit. The forcecontroller controls movement of a robot arm having a plurality of jointson the basis of the position of an end portion of the robot arm obtainedby a position information obtaining unit. The first force detectordetects a force that an operator applies to the robot arm. The jamdetermination unit determines whether an operator or an object is jammedbetween the robot arm and the external structure on the basis of a forcedetected by the first force detector. The joint restriction unitdetermines a joint on which restriction of movement is not to be imposedand a joint on which restriction of movement is to be imposed. The areaclassification unit classifies areas in which the end portion of therobot arm moves into a restricted area in which movement of the robotarm is restricted and an unrestricted area in which movement of therobot arm is not restricted. The restriction period setting sets arestriction period during which unit the movement is restricted.Moreover, if the jam determination unit determines that a jam hasoccurred, during the restriction period set by the restriction periodsetting unit to impose a restriction on movement, the program causes thecomputer to perform control as follows: if the area classification unitdetermines that the end portion of the robot arm is located in therestricted area determined by the area classification unit on the basisof information about the position of the end portion of the robot armobtained by the position information obtaining unit, movement of one ormore of the joints to be restricted is stopped and the first forcecontroller controls movement of at least one of the joints that are notrestricted. After the elapse of a restriction period for whichrestriction on movement is imposed, which is set by the restrictionperiod setting unit, the restriction on the joints is removed. Moreover,if it is determined that the end portion of the robot arm is located inthe unrestricted area that is determined by the directional areaclassification unit, the first force controller controls movement of thejoints without restricting movement of any of the joints.

The program may be downloaded from a server or the like. Alternatively,the program may be stored in a predetermined recording medium (which is,for example, an optical disc such as CD-ROM, a magnetic disc, or asemiconductor memory).

The program may be executed by a single computer or a plurality ofcomputers. In other words, the program may be executed in centralizedprocessing or distributed processing.

The effects of the embodiments or modifications can be obtained by usingappropriate combinations of the embodiment and modifications.

The robot, the device and the method for controlling a robot, and theprogram for controlling a robot according to the present disclosure areuseful as a power-assist robot that performs an operation in cooperationwith an operator, a device and a method for controlling a robot, and aprogram for controlling a robot.

CROSS REFERENCE TO RELATED APPLICATION

The present application claims the benefit of Japanese PatentApplication No. 2014-011945 filed on Jan. 27, 2014. The entiredisclosure of the above-identified application, including thespecification, drawings and claims, is incorporated herein by referencein its entirety.

What is claimed is:
 1. A robot comprising: a position informationobtaining unit that obtains position information about an end portion ofa robot arm having a plurality of joints; a first force detector thatdetects a force that an operator applies to the robot arm; a jamdetermination unit that determines whether or not the operator or anobject is jammed between the robot arm and an external structure on thebasis of the force detected by the first force detector; an areaclassification unit that classifies an area in which the end portionmoves into a restricted area and an unrestricted area; a restrictionperiod setting unit that sets a restriction period during which movementof the robot arm is restricted; a microprocessor that: imposes movementrestriction on, and automatically stops movement of, one or more of theplurality of joints if an elapsed period after detection of the jam isin the restriction period and the end portion is located in therestricted area, and does not restrict movement of at least one of theplurality of joints excluding the one or more of the plurality ofjoints, removes the movement restriction if the elapsed period endsafter the restriction period, and does not impose movement restrictionon the plurality of joints if the elapsed period after detection of thejam is in the restriction period and the end portion is located in theunrestricted area.
 2. The robot according to claim 1, furthercomprising: a second force detector that detects an external force thatthe robot arm receives from the outside, wherein the jam determinationunit determines that the operator or the object is jammed between therobot arm and the external structure on the basis of the force detectedby the first force detector and the external force that the robot armreceives from the outside and that is detected by the second forcedetector, and wherein, if the jam determination unit determines that ajam has occurred, movement of the robot arm is controlled on the basisof the external force that the robot arm receives from the outside andthat is detected by the second force detector.
 3. The robot according toclaim 2, wherein the area classification unit stores a map of anoperation area including the restricted area beforehand.
 4. The robotaccording to claim 2, wherein the area classification unit obtains avelocity of movement of the end portion and classifies an area in whichthe velocity of movement of the end portion is lower than a velocitythreshold into the restricted area.
 5. The robot according to claim 3,wherein the restricted area includes a plurality of areas, and whereinthe area classification unit is a directional area classification unitthat has information about a direction in which movement of each of theplurality of joints is restricted in each of the plurality of areas. 6.The robot according to claim 5, wherein one or more of the plurality ofjoints on which the restriction on movement is to be imposed aredetermined on the basis of information about the plurality of areas andinformation about the direction in which movement of each of theplurality of joints is to be restricted, which are stored in thedirectional area classification unit.
 7. The robot according to claim 1,wherein the restriction on movement is not imposed on at least one ofthe plurality of joints near the end portion.
 8. The robot according toclaim 2, wherein the restriction period setting unit sets a shorterrestriction period when the external force detected by the second forcedetector is larger.
 9. The robot according to claim 2, furthercomprising: an operator/object determination unit, wherein theoperator/object determination unit determines whether a body jammedbetween the end portion of the robot arm and the external structure isthe operator or the object on the basis of the position informationobtained by the position information obtaining unit, the external forcethat the robot arm receives from the outside and that is detected by thesecond force detector, and information determined by the jamdetermination unit, and wherein, if the operator/object determinationunit determines that the body is the operator, the restriction periodsetting unit sets the restriction period to be shorter than that in acase where the operator/object determination unit determines that thebody is the object.
 10. The robot according to claim 9, wherein thesecond force detector estimates an estimated joint torque from a valueof an electric current passing through a driving device of each of theplurality of joints and position information obtained by the positioninformation obtaining unit, wherein the operator/object determinationunit calculates an elastic modulus from the position informationobtained by the position information obtaining unit and the estimatedjoint torque estimated by the second force detector, and wherein theoperator/object determination unit determines that the body that isjammed is the operator if the calculated elastic modulus is less than afirst operator-determination threshold and determines that the body thatis jammed is the object if the calculated elastic modulus is greaterthan or equal to the first operator-determination threshold.
 11. Therobot according to claim 9, wherein the operator/object determinationunit determines that the body that is jammed is the operator if adifference between a maximum value and a minimum value of the externalforce that the robot arm receives from the outside and that is detectedby the second force detector is greater than or equal to a secondoperator-determination threshold.
 12. The robot according to claim 8,wherein the jam determination unit determines that a jam has occurred ifan input from the first force detector is zero and an input from thesecond force detector is greater than or equal to a certain value.
 13. Adevice for controlling a robot, comprising: a position informationobtaining unit that obtains position information about an end portion ofa robot arm having a plurality of joints; a first force detector thatdetects a force that an operator applies to the robot arm; a jamdetermination unit that determines whether or not the operator or anobject is jammed between the robot arm and an external structure on thebasis of the force detected by the first force detector; an areaclassification unit that classifies an area in which the end portionmoves into a restricted area and an unrestricted area; and a restrictionperiod setting unit that sets a restriction period during which movementof the robot arm is restricted; a microprocessor that: imposes movementrestriction on, and automatically stopping movement of, one or more ofthe plurality of joints if an elapsed period after detection of the jamis in the restriction period and the end portion is located in therestricted area, and does not restrict movement of at least one of theplurality of joints excluding the one or more of the plurality ofjoints, removes the movement restriction if the elapsed period endsafter the restriction period, and does not impose movement restrictionon the plurality of joints if the elapsed period after detection of thejam is in the restriction period and the end portion is located in theunrestricted area.
 14. A method for controlling a robot with amicroprocessor, comprising: obtaining position information about an endportion of a robot arm having a plurality of joints; detecting a forcethat an operator applies to the robot arm; performing the following withthe microprocessor: receiving the position information, and forceinformation indicative of the force; classifying an area in which theend portion moves into a restricted area and an unrestricted area;determining whether or not the operator or an object is jammed betweenthe robot arm and an external structure on the basis of the forceinformation; setting a restriction period during which movement of therobot arm is restricted, imposing movement restriction on, andautomatically stopping movement of, one or more of the plurality ofjoints if an elapsed period after detection of the jam is in therestriction period and the end portion is located in the restrictedarea, and not restricting movement of at least one of the plurality ofjoints excluding the one or more of the plurality of joints, removingthe movement restriction if the elapsed period ends after therestriction period, and not imposing movement restriction on theplurality of joints if the elapsed period after detection of the jam isin the restriction period and the end portion is located in theunrestricted area.
 15. A computer-readable non-transitory recordingmedium storing a program for causing a computer to perform operations,the operations including: obtaining position information about an endportion of a robot arm having a plurality of joints; detecting a forcethat an operator applies to the robot arm; receiving the positioninformation, and force information indicative of the force; classifyingan area in which the end portion moves into a restricted area and anunrestricted area; determining whether or not the operator or an objectis jammed between the robot arm and an external structure on the basisof the force information; setting a restriction period during whichmovement of the robot arm is restricted, imposing movement restrictionon, and automatically stopping movement of, one or more of the pluralityof joints if an elapsed period after detection of the jam is in therestriction period and the end portion is located in the restrictedarea, and not restricting movement of at least one of the plurality ofjoints excluding the one or more of the plurality of joints, removingthe movement restriction if the elapsed period ends after therestriction period, and not imposing movement restriction on theplurality of joints if the elapsed period after detection of the jam isin the restriction period and the end portion is located in theunrestricted area.